package com.yunji.order.emuns;

import com.yunji.common.utils.bean.BeanUtils;
import lombok.Getter;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package com.yunji.order.emuns
 * @FileName Settlement.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @version 1.0
 * @since JDK 1.8.0_202
 * @CreateTime 2024-05-11 16:57:34
 * @Description 清算状态
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo0803@163.com	2024-05-11 16:57:34		1.0					1.0 Version
 */
@Getter
public enum OrderFrozenEnum {
    UN_FROZEN(0, "冻结"),
    FROZEN(1, "已解冻") ;

    private final Integer code;
    private final String text;

    OrderFrozenEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }



    public static String get(Integer code) {
        if (BeanUtils.isNull(code)) {
            return null;
        }
        OrderFrozenEnum[] enums = OrderFrozenEnum.values();
        for (OrderFrozenEnum e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }
}